package com.zhl.framework.core.common;

import lombok.Data;

import java.io.Serializable;

import static com.zhl.framework.core.common.constants.RpcConstants.MAGIC_NUMBER;

/**
 * @Author: ZhangLu In DLUT
 * @since: 1.0.0
 * @Description: 网络中传输封装的协议对象
 */
@Data
public class RpcProtocol implements Serializable {

    private static final long serialVersionUID = 5359096060555795690L;

    private short magicNumber = MAGIC_NUMBER;

    private int contentLength;

    private byte[] content;


    public RpcProtocol(byte[] content) {
        this.content = content;
        this.contentLength = content.length;
    }

}
